Create Customer from Lead using Tenant Id

Create Customer from Lead using Tenant Id enables you to create a customer service with a SIP Connection created between the customer tenant service and the SBC device (OnlinePSTNGateway) (configured to connect calls between the PSTN trunk and Microsoft Teams) using the customer's Microsoft Azure tenant Id (see Create Customer from Lead with Tenant Id).

URI

Copy
{{baseUrl}}/api/v2/oc/lead?msTenantID=[Microsoft TenantID]

HTTP Method

PATCH

Request Parameters

Parameter

Type

Description

msTenantId

string

Microsoft Tenant subscription Id of the customer lead.

You can also use the Lead Id "id" (see Get All OC Leads).

Request Body

Parameter

Type

Description

statusChange

string

The applied license type i.e. 'OC Essential'.

customerShortName

string

Customer short name with the following validation rules:

Length between 3 and 15 characters.
No spaces
Include only literal and numerical characters and underscore.

customerFullName

string

Generally the company name, however, any value can be used.

Example Request Body

Copy
 {
  "statusChange": "OCEssential",
  "customerShortName": "Tenant_Walter2",
  "customerFullName": "Walter's Tenant2"

}

Example Response

The initial response displays the Task Id.

Parameter

Type

Description

taskId

string

The queued task Id that is generated for this action. You must run the Task request to retrieve the status of the action. See Task Status. Note that the wst string in the prefix is unique for this endpoint.

Copy
"wst_501f59e0-997c-4545-be3b-a95b200926a2"

The execution of the request may take a few minutes. The status will progress from 'In Progress' to 'Completed Success'.

Copy
{
    "id": "wst_501f59e0-997c-4545-be3b-a95b200926a2",
    "status": "CompletedSuccess",
    "details": [
        "Converted"
    ],
    "executionMessages": [
        {
            "level": "Information",
            "message": "Site created in Ovoc"
        }
    ],
    "outputData": {}
}

Response Codes

200 Success

Parameter

Type

Description

id

string

Task Id

status

string

One of the following values:

In Progress
Completed Success
Completed Failed

details

string

One of the following values:

Converted

executionMessages

list array

List array including the following parameters:

level
message

level

string

One of the following values:

Information
Error

message

string

The following message is displayed in the output of the Get Task Id request, if the customer is created successfully:

Copy
 "message": "Site created in Ovoc"
The following Request body includes a customer name with more than 15 characters.
Copy
{
"statusChange": "OCEssential",
"customerShortName": "BradEurope1234567",
"customerFullName": "BradEurope1234567"
 
}
As a result, the following error is received in the output for this request:
Copy
{
    "errors": {
        "CustomerName": [
            "'Customer Short Name' must be between 3 and 15 characters."
        ]
    },
    "title": "One or more validation errors occurred.",
    "status": 400
}
The following Request body includes an invalid character ".":
Copy
{
  "statusChange": "OCEssential",
  "customerShortName": "BradEurope.1234",
  "customerFullName": "BradEurope.1234"
  

}
As a result, the following error is received in the output for this request:
Copy
{
    "errors": {
        "CustomerName": [
            "Customer Short Name contains invalid characters. Allowed characters: letters, numbers and '_'."
        ],
        "CustomerFullName": [
            "Customer Full Name contains invalid characters. Allowed characters: letters, numbers, _, ' and space."
        ]
    },
    "title": "One or more validation errors occurred.",
    "status": 400
}

umpCustomerGuid

string($uuid)

CustomerGuid created for the customer tenant. This value is equivalent to the Id value extracted using Get Services Brief Details (V3).

If this field is null: An OC license has not yet been applied to the customer lead.

outputData

list array

Additional information.

400 Bad Request

Parameter

Type

Description/Examples

errors

string

Text description of the error.

type

string

"https://tools.ietf.org/html/rfc7231#section-6.5.1"

title

string

Email title. For example "One or more validation errors occurred."

status

string

HTML error code i.e. 400

detail

string

Additional error details.

traceId

 

Error trace Id.

instance

string

Error instance.

Cac Profile

string

Information related to configured CAC sessions.

ProxySet

string

Information related to SBC Proxy Sets.

OnlinePstnGateway

string

Information related to OnlinePSTN Gateway of the SBC device attached to Calling Profiles (see Get Online PSTN Gateway.

404 Not Found
The following example shows an example 404 error for lead that is not valid.
Copy
"Invalild lead"
405 Method Not Allowed
500 Server Error